package com.woniu.crowd.client;

import com.woniu.crowd.client.param.SearchCrowdParam;
import com.woniu.crowd.client.result.CrowdProductResultInfo;
import com.woniu.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(contextId = "crowdQueryClient", name = "crowd")
public interface CrowdQueryClient {
    /**
     * ES查询众筹
     *
     * @param searchCrowd
     * @return
     */
    @PostMapping("searchCrowd")
    public Result searchCrowd(@RequestBody SearchCrowdParam searchCrowd);

    /**
     * 查询个人众筹
     */
    @GetMapping("/listCrowdByUserId")
    Result<List<CrowdProductResultInfo>> listCrowdByUserId(@RequestParam("userId") Integer userId);
}
